home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS2D.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  440b  |  25 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4.  
  5. /*
  6. ** AH = 0x2D
  7. ** CX = hour/min
  8. ** DX = sec/hsec
  9. */
  10. int dos_settime(struct dos_time * dt)
  11. {
  12.     struct REGPACK r;
  13.  
  14.     r.eax = 0x2D00;
  15.     r.ecx = ((unsigned short) dt->dtime_hour << 8) | dt->dtime_minutes;
  16.     r.edx = ((unsigned short) dt->dtime_seconds << 8) | dt->dtime_hsec;
  17.  
  18.     _intr(0x21, &r);
  19.  
  20.     if ((r.eax & 0xFF) == 0xFF)
  21.     return -1;
  22.     else
  23.     return 0;
  24. }
  25.